import cv2
import sys


class ObjectTracker:
    def __init__(self, tracker_type_choose):

        if tracker_type_choose == 'BOOSTING':
            self.tracker = cv2.TrackerBoosting()
        elif tracker_type_choose == 'MIL':
            self.tracker = cv2.TrackerMIL_create()
        elif tracker_type_choose == 'KCF':
            self.tracker = cv2.TrackerKCF_create()
        elif tracker_type_choose == 'TLD':
            self.tracker = cv2.TrackerTLD_create()
        elif tracker_type_choose == 'MEDIANFLOW':
            self.tracker = cv2.TrackerMedianFlow_create()
        elif tracker_type_choose == 'GOTURN':
            self.tracker = cv2.TrackerGOTURN_create()
        elif tracker_type_choose == 'MOSSE':
            self.tracker = cv2.TrackerMOSSE_create()
        elif tracker_type_choose == "CSRT":
            self.tracker = cv2.TrackerCSRT_create()
        else:
            print('Do not have this tracker')

    def tracker_init(self, im0, bbox):
        self.tracker.init(im0, bbox)
        return self.tracker




